<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
            var  n =prompt("请输入输出几行三角形");
            var  m =prompt("请输入输出几行菱形");
        
    </script>
    		<script>
                // 三角形
                       for (let a = 0; a < n; a++) {
                       //控制空白部分
                           for (let b = n; b >= a; b--) {
                               document.write("&nbsp;");
                           }
                           for (let c = 0; c < a + 1; c++) 
                           {
                               document.write("&nbsp*");
                           }
                           document.write("<br>");//控制每次打印完当前行然后换行
                       }
 
         </script>
         <script>
             //平行四边形
                     for (let i = 0; i < m; i++) {
                         for (let k = i; k <= m; k++) 
                         {
                             document.write("&nbsp;");
                         }
                         for (let j = 0; j < m; j++) 
                         {
                             document.write("&nbsp*");
                         }
                         document.write("<br>");
                     }
         </script>
         <!-- 菱形 -->
         <script>
                for(var h = 1;h<=m;h++){
                     for(var k = 1;k<=m-h;k++){
                         document.write("&nbsp");
                     }
                     for(var s = 1;s<=h;s++){
                         document.write("&nbsp;*");
                     }
                     document.write("<br>");
                 }
                 for(var h = 1;h<=m-1;h++){
                     for(var k = 1;k<=h;k++){
                         document.write("&nbsp");
                     }
                     
                     for(var s =1;s<=m-h;s++){
                         document.write("&nbsp;*");
                     }
                     document.write("<br>");
                 }
         </script>
         <script>
             document.write("219970111雷德亮");
         </script>
 
</body>
</html>